package com.nuc.lsp2;

/**
 * Time    : 2023/3/26 10:55
 * Author  : 王摇摆
 * FileName: Animal.java
 * Software: IntelliJ IDEA 2020.2.2
 * Blog    ：https://blog.csdn.net/weixin_44943389?type=blog
 */

public class Animal {
    private double runSpeed;


    //getter和setter需要什么写什么，类内访问的话直接使用this调用私有数据成员即可
    public void setRunSpeed(double runSpeed) {
        this.runSpeed = runSpeed;
    }

    public double getRunTime(double distance) {
        return distance / this.runSpeed;

    }
}
